
package com.xbongbong.sys.domain.dao;

import com.xbongbong.sys.domain.entity.CompanyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author kaka
 */
@Repository
@Mapper
public interface CompanyDao {

    Integer insert(CompanyEntity company);

    Integer update(CompanyEntity company);

    Integer deleteByKey(@Param("key") String key);

    CompanyEntity getByKey(@Param("key") String key);

    List<CompanyEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    List<Map<String, Object>> findFeeCompanyEntitys(@Param("param") Map<String, Object> param);

    Integer getEndTime(@Param("param") Map<String, Object> param);

    Integer insertFeeCompany(CompanyEntity company);

    List<Map<String, Object>> companyStatic(@Param("param") Map<String, Object> param);

    List<Map<String, Object>> companyTotalNumDay(@Param("param") Map<String, Object> param);

    List<Map<String, Object>> companyTotalNumHour(@Param("param") Map<String, Object> param);


    /**
     * 根据公司名称获取公司id队列
     *
     * @param corpNameLike 模糊搜索的公司名称
     *
     * @return 公司ID队列
     */
    List<String> getCorpIdListByCorpNameLike(@Param("corpNameLike") String corpNameLike);

    List<String> getCorpidList();
    
    List<String> getCorpidListByStatus();

    /**
     * 获取有效期内公司
     */
    List<String> getCorpidListByActive();

    /**
     * 获取没有配置钉钉待办的公司corpid
     * @param configAlias
     * @return
     */
    List<String> getCorpidListNotInCompanyConfig(@Param("configAlias") String configAlias);

    List<String> getJxcCorpidList();

    List<String> getJxcCorpidListTemporary();

    void insertBatch(@Param("list") List<String> subList);

    List<String> getJxcCorpidListByActive();
}